﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wekit.Model.Auth
{
    public   class UserRole
    {
        public virtual string Id { get; set; }
        public virtual User User { get; set; }
        public virtual Role Role { get; set; }

        public virtual string Remark { get; set; }

        public override bool Equals(object obj)
        { 
            UserRole userRoleId = obj as UserRole;
            if (userRoleId.Role.Equals(this.Role) && userRoleId.User.Equals(this.User))
                return true;
            return false;
        }

        public override int GetHashCode()
        {
            return this.User.GetHashCode() + this.Role.GetHashCode() * 10;
        }
    }
}
